import pymysql
# conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', password='zl122100!E', database='calender', charset='utf8')
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', password='root', database='calender', charset='utf8')
cur = conn.cursor()
sql="select * from repetition "
# sql = "insert into normal(id,this_year,this_month,this_day,color,start_time,end_time,is_all_day,title,details) VALUES \
#     (111,'2022','12','21','green','12:00','17:05',False,'晨曦','fytfug'),\
#     (121,'2022','11','21','blue','11:00','17:23',False,'chenchen','vytuy') ;  "

cur.execute(sql)
conn.commit()
test1 = cur.fetchall()
year1 = {}
# month1 = {}
# day1 = {}
repetition=[]
for i in test1:
    
    task = {}
    task["id"]=i[0]
    task["color"]=i[1]
    task["start_time"]=i[2]
    task["end_time"]=i[3]
    if i[4]==0:
        task["is_all_day"]=False
    else:
        task["is_all_day"]=True
    task["title"]=i[5]
    task["details"]=i[6]
    task["repetition_type"]=i[7]
    task["repetition_subtype"]=i[8]
    task["repetition_value"]=i[9]
    repetition.append(task)

    
       
print(repetition)